package com.zhuxulin.tab.anim;

import android.content.Context;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

import com.zhuxulin.tab.R;

public final class Animations {
	private static Animation slideRightIn = null;
	private static Animation slideLeftOut = null;
	private static Animation slideLeftIn = null;
	private static Animation slideRightOut = null;
	private static String TAG=Animations.class.getSimpleName();
	private Animations() {
	}

	private static void init(Context context) {
		slideLeftIn = AnimationUtils.loadAnimation(context, R.anim.left_in);
		slideLeftOut = AnimationUtils.loadAnimation(context, R.anim.left_out);
		slideRightIn = AnimationUtils.loadAnimation(context, R.anim.right_in);
		slideRightOut = AnimationUtils.loadAnimation(context, R.anim.right_out);
	}

	public static Animation slideRightIn(Context context) {
		if (slideLeftIn == null)
			init(context);
		return slideRightIn;
	}

	public static Animation slideLeftOut(Context context) {
		if (slideLeftOut == null)
			init(context);
		return slideLeftOut;
	}

	public static Animation slideLeftIn(Context context) {
		if (slideLeftIn == null)
			init(context);
		return slideLeftIn;
	}

	public static Animation slideRightOut(Context context) {
		if (slideRightOut == null)
			init(context);
		return slideRightOut;
	}
}
